//count_if example
#include <iostream>     //std::cout
#include <algorithm>    //std::count_if
#include <vector>       //std::vector
using namespace std;


int main(){
    std::vector<int> vec;
    for(int i = 1;i<10;i++) vec.push_back(i);//myvector: 1 2 3 4 5 6 7 8 9 
    int value = 3;
    int cnt = count_if(vec.begin(),vec.end(),[=](int i){return i>value;});
    cout << "Found  " << cnt << " values > " << value << endl;
    return 0;
}